home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utilwb / mf4fxdsk.lha / fax_for_MTerm4.0 / source / faxMain.c < prev    next >
C/C++ Source or Header  |  1996-04-27  |  3KB  |  103 lines

  1. /* Libraries */
  2. #include <libraries/mui.h>
  3. #include <libraries/gadtools.h> /* for BARLABEL in MenuItem */
  4.  
  5. /* Prototypes */
  6. #include <clib/muimaster_protos.h>
  7. #include <clib/exec_protos.h>
  8. #include <clib/alib_protos.h>
  9. #include <clib/dos_protos.h>
  10.  
  11.  
  12. /*  Pragmas  */
  13. #include <pragma/muimaster_lib.h>
  14. #include <pragma/exec_lib.h>
  15.  
  16. /*  Ansi  */
  17. #include <stdlib.h>
  18. #include <stdio.h>
  19. #include <wbstartup.h>
  20. /* GenCodeC header end */
  21.  
  22. #include "faxGUI.c"
  23.  
  24. /* Declarations for libraries */
  25. struct Library * MUIMasterBase;
  26. struct Library * LocaleBase;
  27.  
  28. /* Init() function */
  29. void init( void )
  30. {
  31.         if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  32.         {
  33.                 printf("Can't Open MUIMaster Library\n");
  34.                 exit(20);
  35.         }
  36.         if (!(LocaleBase = OpenLibrary("locale.library",38)))
  37.         {
  38.                 printf("Can't Open Locale Library\n");
  39.                 printf("Built-in Language will be used !!!\n");
  40.         }
  41.         OpenAppCatalog(NULL,NULL);
  42. }
  43. void end( void )
  44. {
  45.         CloseAppCatalog();
  46.         if (LocaleBase)
  47.                 CloseLibrary(LocaleBase);
  48.         CloseLibrary(MUIMasterBase);
  49.         exit(0);
  50. }
  51.  
  52. int main(int argc,char *argv[])
  53. {
  54.         struct ObjApp * App = NULL;     /* Object */
  55.         BOOL    running = TRUE;
  56.         ULONG   signal;
  57.  
  58.         /* Program initialisation */
  59.         init();
  60.  
  61.         /* Create Object */
  62.         if (!(App = CreateApp()))
  63.         {
  64.                 printf("Can't Create App\n");
  65.                 end();
  66.         }
  67.  
  68.         while (running)
  69.         {
  70.                 switch (DoMethod(App->App,MUIM_Application_Input,&signal))
  71.                 {
  72.                         case MUIV_Application_ReturnID_Quit:
  73.                                 running = FALSE;
  74.                                 break;
  75.  
  76.                         case BT_PRINTER:
  77.                                       system("run >nil: server");
  78.                                 break;
  79.                         case BT_SPOOLER:
  80.                                       system("run >nil: spooler");
  81.                                 break;
  82.                         case BT_LOGBOOK:
  83.                                       system("run >nil: logbook");
  84.                                 break;
  85.                         case BT_CONFIG:
  86.                                       system("run >nil: config");
  87.                                 break;
  88.                         case BT_DESK:
  89.                                       system("execute faxdesk");
  90.                                 break;
  91.                         case BT_PHONE:
  92.                                       system("execute faxphone");
  93.                                 break;
  94.                         case BT_VIEW:
  95.                                       system("execute faxview");
  96.                             break;
  97.                 }
  98.                 if (running && signal) Wait(signal);
  99.         }
  100.         DisposeApp(App);
  101.         end();
  102. }
  103.